package com.vimi8.ebb.api.ebb;

import com.vimi8.ebb.configuration.HttpResponseEntity;
import com.vimi8.ebb.dto.LogisticsBusinessDTO1;
import com.vimi8.ebb.dto.LogisticsDTO;
import com.vimi8.ebb.model.Logistics;
import com.vimi8.ebb.model.LogisticsBusiness;
import com.vimi8.ebb.model.Paginator;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 物流信息api
 * Created by xiehuang on 2017/1/19.
 */
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringCodegen", date = "2016-09-12T05:46:07.581Z")
@RestController
@Api(value = "logistics", description = "the logistics API")
public interface LogisticsApi {
    @ApiOperation(value = "查询物流信息", notes = "查询物流信息.", response = Logistics.class,
            tags = {"物流信息",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回物流信息列表", response = Logistics.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class)})
    @RequestMapping(value = "/logistics/",
            method = RequestMethod.GET)
    HttpResponseEntity<Paginator<List<LogisticsDTO>>> getLogistics(
            @ApiParam(value = "当前页码", required = true) @RequestParam(value = "start", required = true) int start,
            @ApiParam(value = "每页大小", required = true) @RequestParam(value = "size", required = true) int size,
            @ApiParam(value = "地址编码", required = false) @RequestParam(value = "addressCode", required = false) String addressCode,
            @ApiParam(value = "网点名称", required = false) @RequestParam(value = "branchName", required = false) String branchName
    );

    @ApiOperation(value = "查询最新的物流信息", notes = "查询最新的物流信息.", response = Logistics.class,
            tags = {"物流信息",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回最新的物流信息列表", response = Logistics.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class)})
    @RequestMapping(value = "/logistics/latest",
            method = RequestMethod.GET)
    HttpResponseEntity<Paginator<List<LogisticsBusinessDTO1>>> getLogisticsLatest(
            @ApiParam(value = "当前页码", required = true) @RequestParam(value = "start", required = true) int start,
            @ApiParam(value = "每页大小", required = true) @RequestParam(value = "size", required = true) int size,
            @ApiParam(value = "地址编码", required = false) @RequestParam(value = "addressCode", required = false) String addressCode,
            @ApiParam(value = "网点名称", required = false) @RequestParam(value = "branchName", required = false) String branchName,
            @ApiParam(value = "统计时间", required = false) @RequestParam(value = "statisticsTime", required = false) String statisticsTime,
            @ApiParam(value = "统计结束时间", required = false) @RequestParam(value = "endTime", required = false) String endTime
    );

    @ApiOperation(value = "根据ID查询物流信息", notes = "根据ID查询物流信息.", response = Logistics.class,
            tags = {"物流信息",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回物流信息", response = Logistics.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class)})
    @RequestMapping(value = "/logistics/{id}",
            method = RequestMethod.GET)
    HttpResponseEntity<LogisticsDTO> getLogisticsById(
            @ApiParam(value = "id", required = true) @PathVariable(value = "id", required = true) String id
    );

    @ApiOperation(value = "导入物流信息", notes = "导入物流信息.", response = String.class,
            tags = {"物流信息",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回导入成功的提示信息", response = String.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class)})
    @RequestMapping(value = "/logistics/import",
            method = RequestMethod.POST)
    HttpResponseEntity<Object> importLogistics(@RequestParam("file") MultipartFile file
    );

    @ApiOperation(value = "导出物流信息", notes = "导出物流信息.", response = String.class,
            tags = {"物流信息",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回导出成功的提示信息", response = String.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class)})
    @RequestMapping(value = "/logistics/export",
            method = RequestMethod.GET)
    void exportLogistics(
            @ApiParam(value = "地址编码", required = false) @RequestParam(value = "addressCode", required = false) String addressCode,
            @ApiParam(value = "网点名称", required = false) @RequestParam(value = "branchName", required = false) String branchName,
            @ApiParam(value = "时间", required = false) @RequestParam(value = "statisticsTime",required = false) String statisticsTime,
            @ApiParam(value = "时间", required = false) @RequestParam(value = "endTime",required = false) String endTime,
                                               HttpServletResponse response);

    @ApiOperation(value = "添加物流信息", notes = "添加物流信息.", response = String.class,
            tags = {"物流信息",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回影响行数", response = String.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class)})
    @RequestMapping(value = "/logistics/",
            method = RequestMethod.POST)
    HttpResponseEntity<String> addLogistics(
            @ApiParam(value = "物流信息", required = true) @RequestBody Logistics logistics
    );

    @ApiOperation(value = "添加业务量", notes = "添加业务量.", response = String.class,
            tags = {"物流信息",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回影响行数", response = String.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class)})
    @RequestMapping(value = "/logistics/business",
            method = RequestMethod.POST)
    HttpResponseEntity<String> addLogisticsBusiness(
            @ApiParam(value = "业务量Model", required = true) @RequestBody LogisticsBusiness logisticsBusiness
    );

    @ApiOperation(value = "修改物流信息", notes = "修改物流信息.", response = String.class,
            tags = {"物流信息",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回影响行数", response = String.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class)})
    @RequestMapping(value = "/logistics/",
            method = RequestMethod.PUT)
    HttpResponseEntity<String> updateLogistics(
            @ApiParam(value = "物流信息", required = true) @RequestBody Logistics logistics
    );

    @ApiOperation(value = "删除物流信息", notes = "删除物流信息.", response = String.class,
            tags = {"物流信息",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回影响行数", response = String.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class)})
    @RequestMapping(value = "/logistics/",
            method = RequestMethod.DELETE)
    HttpResponseEntity<String> deleteLogistics(
            @ApiParam(value = "物流信息id", required = true) @RequestParam(value = "id", required = true) String id
    );

    @ApiOperation(value = "批量删除物流信息", notes = "批量删除物流信息.参数形如：'xxxx','xxxx','xxxx'", response = String.class,
            tags = {"物流信息",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回影响行数", response = String.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class)})
    @RequestMapping(value = "/logistics/deleteSelectedAll/",
            method = RequestMethod.DELETE)
    HttpResponseEntity<String> deleteSelectedAllLogistics(
            @ApiParam(value = "物流信息ids", required = true) @RequestBody(required = true) String ids
    );

    @ApiOperation(value = "删除物流业务量信息", notes = "删除物流业务量信息.", response = String.class,
            tags = {"物流信息",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回影响行数", response = String.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class)})
    @RequestMapping(value = "/logistics/business/{id}",
            method = RequestMethod.DELETE)
    HttpResponseEntity<String> deleteLogisticsBusiness(
            @ApiParam(value = "物流业务量id", required = true) @PathVariable(value = "id", required = true) String id
    );
}
